// app.ts
App<IAppOption>({
  globalData: {
    navBarHeight: 0, 
    menuLeft: 0,
    statusBarHeight:0
  },
  onLaunch() {
 
    const { statusBarHeight } = wx.getSystemInfoSync();
    // 获取胶囊信息
    const {  height, left, top } = wx.getMenuButtonBoundingClientRect();
    // 计算标题栏高度
    this.globalData.navBarHeight = height + (top - statusBarHeight) * 2;
    // 计算导航栏高度
    this.globalData.menuLeft = left;
    this.globalData.statusBarHeight=statusBarHeight;
  },
})